package net.samsb.request;

import net.samsb.BaseApplication;
import net.samsb.response.HttpResponseListener;

import okhttp3.Request;

import static net.samsb.activity.Constants.HOME_GET_DOOR_LIST;
import static net.samsb.activity.Constants.URL_DOMAIN_NAME;

public class DoorListRequest {

    public void geDoorListMessage() {
        final Request request = new Request.Builder()
                .url("http://" + URL_DOMAIN_NAME + "/AjaxAction.do?type=getPassagewayList")
                .build();

        BaseApplication.mOkHttpClient
                .newCall(request)
                .enqueue(new HttpResponseListener(HOME_GET_DOOR_LIST, -1));
    }

    public void geDoorListMessageTest(String domain) {

        final Request request = new Request.Builder()
                .url("http://" + domain + "/AjaxAction.do?type=getPassagewayList")
                .build();

        BaseApplication.mOkHttpClient
                .newCall(request)
                .enqueue(new HttpResponseListener(HOME_GET_DOOR_LIST, -1));
    }

}
